<?PHP $this->_extends('_layouts/manager_layout');?>
<?PHP $this->_block('contents');?>
<style>
.tree ul{}
.tree li{padding:1px 20px; width:200px}
</style>
<h2 class="aa1">运费 编辑  <?=$shipment->title?> </h2>
<form action="" method="post" >
<div>
	<span>名:</span> <input type="text" name="title" value="<?=$shipment->title?>"  size="40" /> <br />
	<?php if($shipment->id):?>
	<span>状态 :</span> 
		<?php if($shipment->status&1):?>
		 	正在使用,  <a href="<?=url('/shipmentstatusmodify',array('id'=>$s['id'],'status'=>'0'))?>" style="margin-left:20px" onclick="return confirm('确定停用吗')">Stop</a>
		 <?php else:?>
			未使用, <a href="<?=url('/shipmentstatusmodify',array('id'=>$s['id'],'status'=>'1'))?>" style="margin-left:20px" onclick="return confirm('确定启用吗')">Install</a>
		<?php endif;?>
	<?php endif;?>
</div>

<table id='config'>
	<tr>
		<th> Countries </th>
		<th width="120">首重(g)/首重费</th>
		<th width="120">继重(g)/继重费</th>
	</tr>
		<?php $i=0;
		if(is_array($shipment->config)&&count($shipment->config)):
			foreach($shipment->config as $c): $i++;
		?>
	<tr>
		<td><textarea  rows="5" cols="60" name="countries[<?=$i?>]"><?=$c['countries']?></textarea></td>
		<td><input type="text" name="heavy[<?=$i?>]" size="10" value="<?=$c['heavy']?>" />g <br/>
			<input type="text" name="heavyfee[<?=$i?>]" size="10" value="<?=$c['heavyfee']?>" /></td>
		<td><input type="text" name="continude[<?=$i?>]" size="10" value="<?=$c['continude']?>" />g <br />
			<input type="text" name="continudefee[<?=$i?>]" size="10" value="<?=$c['continudefee']?>" /></td>
	</tr>
		<?php endforeach;endif;?>
	<tr style=" display:none">
		<td><textarea  rows="5" cols="60" name="countries[]"></textarea></td>
		<td><input type="text" name="heavy[]" size="10" value="0" />g <br/>
			<input type="text" name="heavyfee[]" size="10" value="0.0" /></td>
		<td><input type="text" name="continude[]" size="10" value="0" />g <br />
			<input type="text" name="continudefee[]" size="10" value="0.0" /></td>
	</tr>
</table>
			
<input type="button" value="   add   " id="addrow" />

<input type="submit" value="   确定   "  />  
<a href="<?=url('storemanager/shipment')?>" >返回 Shipment List</a>

<input type="hidden" value="<?=$shipment->id?>" name="id" />
</form>
<br style="clear:both">
<script language="javascript">
$('#addrow').click(function(){
	$('#config').append('<tr><td><textarea  rows="5" cols="60" name="countries[]"></textarea></td> <td><input type="text" name="heavy[]" size="10" value="0" />g <br/> <input type="text" name="heavyfee[]" size="10" value="0.0" /></td> <td><input type="text" name="continude[]" size="10" value="0" />g <br /> <input type="text" name="continudefee[]" size="10" value="0.0" /></td> </tr>'); 
})
</script>
<?PHP $this->_endblock();?>

